package com.example.designpattern.strategy_pattern.b;

/**
 * 环境类
 */
public class Context {

    private AbstractStrategy abstractStrategy;

    public void setAbstractStrategy(AbstractStrategy abstractStrategy) {
        this.abstractStrategy = abstractStrategy;
    }

    //调用策略类中的算法
    public void algorithm() {
        abstractStrategy.algorithm();
    }
}
